#!/bin/sh -f
# CopyRight:    Copyright(C): dGB Beheer B. V. 2013
# Description:  Script to launch installer
# Author:       Nageswara
# Date:         May 2013
# RCS:          $Id$

if [ ! -f /bin/csh ]; then
    echo "You do not have csh installed which is required by OpendTect"
    echo "Please install csh or contact your system administrator."
    exit 1
fi

#get rid of the OD environment.
if [ $?DTECT_APPL ]; then
    export DTECT_APPL=""
fi

PLFNAME=`uname`
curdir=`dirname "$0"`

if [ "${PLFNAME}" = "Darwin" ]; then
    if [ ! $?DYLD_LIBRARY_PATH ]; then
	export DYLD_LIBRARY_PATH="${curdir}"
    else
	export DYLD_LIBRARY_PATH="${curdir}":${DYLD_LIBRARY_PATH}
    fi
else
    if [ ! $?LD_LIBRARY_PATH ]; then
	export LD_LIBRARY_PATH="${curdir}"
    else
	export LD_LIBRARY_PATH="${curdir}":${LD_LIBRARY_PATH}
    fi
fi

"${curdir}/od_instmgr" $*

exit $?
